package com.sailorj.controller;

import com.sailorj.entity.SysLog;
import com.sailorj.service.SysLogService;
import com.sailorj.util.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: com.sailorj
 * @description:操作日志控制层
 * @author: huangshengjun
 * @create: 2020-04-02 16:15
 **/
@CrossOrigin  //后端解决跨域方法注解
@RestController
@RequestMapping("/log")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping(value = "/getSysLogById",method = RequestMethod.GET)
    public SysLog getSysLogById(int id){
        return sysLogService.getSysLogById(id);
    }

    @RequestMapping(value = "/getSysLogList",method = RequestMethod.GET)
    PageBean getSysLogList(@RequestParam(defaultValue = "1") Integer page,
                           @RequestParam(defaultValue = "10") Integer size){
        return sysLogService.getSysLogList(page,size);
    }

}
